from flask import Flask, render_template

name = 'Grey Li'
movies = [
    {'title': 'My Neighbor Totoro', 'year': '1988'},
    {'title': 'Dead Poets Society', 'year': '1989'},
    {'title': 'A Perfect World', 'year': '1993'},
    {'title': 'Leon', 'year': '1994'},
    {'title': 'Mahjong', 'year': '1996'},
    {'title': 'Swallowtail Butterfly', 'year': '1996'},
    {'title': 'King of Comedy', 'year': '1999'},
    {'title': 'Devils on the Doorstep', 'year': '1999'},
    {'title': 'WALL-E', 'year': '2008'},
    {'title': 'The Pork of Music', 'year': '2012'},
]

app = Flask(__name__)

@app.route('/for')
def index_for():
    print("test for")
    return render_template('2_index_for.html', name=name, movies=movies)

@app.route('/if')
def index_if():
    print("test if")
    return render_template('1_templates_if.html', username="Zero", bio="I am Zero")

if __name__ == "__main__":
    any_ip = "0.0.0.0"
    http_port = 8088
    app.run(any_ip, http_port)
